{% extends "myadmin/base.html" %}

{% block mainbody %}
<script type="text/javascript">
    function doDel(url){
        if(confirm("确定要删除吗？")){
            window.location=url
        }
    }
</script>                
    <h2>
        商品类别信息管理
    </h2>
    <table class="table table-bordered table-striped">
        <thead>
            <tr>
                <th>id号</th>
                <th>列表名称</th>
                <th style="width: 150px">父类别pid号</th>
                <th style="width: 150px">分类路径path</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {% for vo in typelist %}
            <tr>
                <td>{{ vo.id }}</td>
                <td>{{ vo.pname }}|--{{ vo.name }}</td>
                <td>{{ vo.pid }}</td>
                <td>{{ vo.path }}</td>
                <td>
                    <a href="{% url 'myadmin_type_add' vo.id %}" class="view-link" style="margin-right: 20px">添加子类别</a>
                    <a href="{% url 'myadmin_type_edit' vo.id %}" class="view-link" style="margin-right: 20px">编辑</a>
                    <a href="javascript:doDel('{% url 'myadmin_type_del' vo.id %}')" class="view-link" style="margin-right: -100px">删除</a>    
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
{% endblock %}
